require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../utils/util"));

var t = getApp();

Page({
    data: {
        statsData: {},
        cardDay: "month",
        orderDay: "month",
        orderList: [ {
            nameClass: "icon-fontclass-daifukuan",
            title: "待支付",
            navigation: "/packageF/teamOrder/teamOrder?status=0",
            status: 0
        }, {
            nameClass: "icon-fontclass-daifahuo",
            title: "待发货",
            navigation: "/packageF/teamOrder/teamOrder?status=1",
            status: 1
        }, {
            nameClass: "icon-fontclass-daishouhuo1",
            title: "待收货",
            navigation: "/packageF/teamOrder/teamOrder?status=2",
            status: 2
        }, {
            nameClass: "icon-fontclass-shouhouliebiao",
            title: "售后列表",
            navigation: "/packageF/teamOrder/teamOrder?status=4",
            status: 4
        }, {
            nameClass: "icon-fontclass-quanbudingdan",
            title: "全部订单",
            navigation: "/packageF/teamOrder/teamOrder?status=-999",
            status: -999
        } ]
    },
    onLoad: function(t) {
        this.statsData();
    },
    statsData: function() {
        var a = this, e = t.getNetAddresss("plugin.team-analysis.frontend.index.index");
        console.log(e + ">>>>>"), t._getNetWork({
            url: e,
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e + "????????"), a.setData({
                    statsData: e.data
                })) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onOrderTo: function(t) {
        console.log(t);
        var a, e, n, i, o = t.currentTarget.dataset.navto, s = "", r = "";
        -999 === t.currentTarget.dataset.status ? (s = 0, r = 9999999999) : "month" === this.data.orderDay ? (s = null === (a = this.data.statsData.month_timestamp) || void 0 === a ? void 0 : a.start_time, 
        r = null === (e = this.data.statsData.month_timestamp) || void 0 === e ? void 0 : e.end_time) : (s = null === (n = this.data.statsData.day_timestamp) || void 0 === n ? void 0 : n.start_time, 
        r = null === (i = this.data.statsData.day_timestamp) || void 0 === i ? void 0 : i.end_time);
        wx.navigateTo({
            url: "".concat(o, "&start_time=").concat(s, "&end_time=").concat(r)
        });
    },
    onMyevent: function(t) {
        console.log(t), console.log("测试传的值");
        var a = t.detail.timeCard, e = t.detail.typename;
        console.log(e), "income" === e ? this.setData({
            cardDay: a
        }) : this.setData({
            orderDay: a
        });
    },
    onSeconds: function(t) {
        var a = "", e = "";
        if ("income" == t.detail) {
            var n, i, o, s;
            if ("month" === this.data.cardDay) a = null === (n = this.data.statsData.month_timestamp) || void 0 === n ? void 0 : n.start_time, 
            e = null === (i = this.data.statsData.month_timestamp) || void 0 === i ? void 0 : i.end_time; else a = null === (o = this.data.statsData.day_timestamp) || void 0 === o ? void 0 : o.start_time, 
            e = null === (s = this.data.statsData.day_timestamp) || void 0 === s ? void 0 : s.end_time;
            wx.navigateTo({
                url: "/packageF/balance/balance?status=0&start_time=".concat(a, "&end_time=").concat(e)
            });
        } else a = 0, e = 9999999999, wx.navigateTo({
            url: "/packageF/teamOrder/teamOrder?status=-999&start_time=".concat(a, "&end_time=").concat(e)
        });
    },
    onWithdrawal: function() {
        wx.navigateTo({
            url: "/packageA/member/withdrawal/withdrawal"
        });
    },
    secondLevel: function() {
        wx.navigateTo({
            url: "/packageF/incomeDetail/incomeDetail"
        });
    },
    onOrder: function() {
        wx.navigateTo({
            url: "/packageF/performance/performance"
        });
    },
    onClient: function(t) {
        var a = t.currentTarget.dataset.id;
        0 === a ? wx.navigateTo({
            url: "/packageF/clientDetails/clientDetails"
        }) : wx.navigateTo({
            url: "/packageF/gradeDetails/gradeDetails?diviLevel=".concat(a)
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});